www.gusucode.com > VC 画直线源代码源码程序 > VC 画直线源代码源码程序/code/Line.cpp
// Line.cpp: implementation of the Line class. // Download by http://www.NewXing.com ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "图形学.h" #include "Line.h" #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]=__FILE__; #define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// Line::Line() { can_be_display=false; } Line::~Line() { } void Line::display() { if(can_be_display==true) { CPaintDC dc(cwnd); CPen pen; pen.CreatePen(PS_SOLID,3,RGB(100,100,100)); dc.SelectObject(&pen); dc.MoveTo(point1); dc.LineTo(point2); pen.DeleteObject(); ::ReleaseDC(cwnd->m_hWnd,dc); } }